<div class="avatar item-img" style="background-image: url('../assets/img/teacher.jpg')"></div>
<p class="lh3 oneline tc">小小的少年</p>
<p class="lh3 oneline tc">厦门大学</p>
<div class="line1"></div>
<ul>
    <li class="userinfonav lh4 tc">
        <a class="<?php echo ($_GET['left']=='fav')?'_active_primary':''; ?>" href="./profile.php?left=fav&right=course">
            <span class="ion-ios-heart-outline"></span> 我的收藏
        </a>
    </li>
    <li class="userinfonav lh4 tc">
        <a class="<?php echo ($_GET['left']=='courseware')?'_active_primary':''; ?>" href="./profile.php?left=courseware">
            <span class="ion-paperclip"></span> 课件中心
        </a>
    </li>
    <li class="userinfonav lh4 tc">
        
        <?php if(1){ ?>

            <a class="teacherlogin  <?php echo ($_GET['left']=='teacher')?'_active_primary':''; ?>" href="javascript:void(0);">
                <span class="ion-ios-lightbulb-outline"></span> 教师中心
            </a>

        <?php }else{ ?>
            <a class="<?php echo ($_GET['left']=='teacher')?'_active_primary':''; ?>" href="./profile.php?left=teacher&right=repair">
                <span class="ion-ios-lightbulb-outline"></span> 教师中心
            </a>
        <?php } ?>


    </li>
</ul>

<script type="text/javascript">
    window.onload = function(){

    $('.teacherlogin').on('click',function(){

      layer.prompt({title: '登录教师中心,请输入密码', formType: 1}, function(text, index){
        layer.close(index);
        layer.msg('DEBUG: '+text);

        var data = {
            "tpassword":$.md5(text)
        };


        // $.post('/index.php/WebApp/Users/checkTeacher',data ,function(result){
        //     var result = JSON.parse(result);
        //     if(!result.errcode){
        //         layer.msg(result.errmsg,{"time":1000});
        //     }else{
        //         layer.msg(result.errmsg,{"time":1000},function(){
        //           // 登录成功,跳转到教师中心
        //           //window.location.href='';
        //         });
        //     }
        // })



        layer.confirm('登录成功,进入教师中心?', {icon: 1, title:'提示'}, function(index){
          //do something
          $('.cover').click();
          layer.close(index);
          setTimeout(function(){
            window.location.href="./profile.php?left=teacher&right=repair";
        },500);
          
        });

      });


    })

    }



</script>
